package com.eudon.design_pattern.creational.abstract_factory;

import com.eudon.design_pattern.creational.abstract_factory.factory.Factory;
import com.eudon.design_pattern.creational.abstract_factory.factory.HighPhoneFactory;
import com.eudon.design_pattern.creational.abstract_factory.factory.LowPhoneFactory;
import com.eudon.design_pattern.creational.abstract_factory.factory.MiddlePhoneFactory;

/**
 * @author eudon
 * @description 使用示例
 * @date 2025/9/1
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class Use {
    public static void main(String[] args) {
        Phone highConfigPhone = createPhone(new HighPhoneFactory());
        System.out.println(highConfigPhone);
        Phone middleConfigPhone = createPhone(new MiddlePhoneFactory());
        System.out.println(middleConfigPhone);
        Phone lowConfigPhone = createPhone(new LowPhoneFactory());
        System.out.println(lowConfigPhone);

    }
    private static Phone createPhone(Factory factory) {
        return factory.getPhone();
    }
}
